MQ-4 Gas Sensor :
Monitor your home Gas leakage with your mobile phone. This sensor detects the concentration of methane and CNG gas in the air and outputs its reading as an analog voltage and digital voltage . The concentration sensing range of 300 ppm to 10,000 ppm is suitable for leak detection.
Components:
1:Node Mcu Esp8266.
2:MQ-4 Gas sensor.
3:LED 4:Resistors
5:Buzzer
6:Bread board.
7:Some jumper wires
Blynk:
Circuit Diagram:
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
char auth[] = "Auth Code"; //Auth Code from blynk
char ssid[] = "WiFi SSID"; //your WiFi SSID
char pass[] = "Password"; //Password of your wifi network
int n;
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
pinMode(16,OUTPUT);
pinMode(5,OUTPUT);
timer.setInterval(1000L, sendUptime);
}
void sendUptime()
{
Blynk.virtualWrite(V1, n);
}
void loop()
{
Blynk.run();
timer.run();
n=analogRead(A0);
Serial.println(n);
if(n>300)
{
digitalWrite(16,LOW);
digitalWrite(5,HIGH);
WidgetLED led1(V0);
led1.on();
WidgetLED led2(V2);
led2.off();
}
if(n<200)
{
digitalWrite(16,HIGH);
digitalWrite(5,LOW);
WidgetLED led1(V0);
led1.off();
WidgetLED led2(V2);
led2.on();
}
}
Video:
MQ-4 Methane Gas Sensor - CNG Gas sensor
https://www.youtube.com/watch?v=eS1WW...
MQ-4 Sensor with Arduino | Methane Gas Sensor | CNG Gas sensor
https://www.youtube.com/watch?v=69TWq...
MQ-4 Gas Sensor with ESP8266 and Blynk application | IOT Project
https://www.youtube.com/watch?v=guXOUc4TdK8&t=109s
Image:
Post a Comment